/*
 * To change this license header, choose License Headers in Project Properties.
 * To change this template file, choose Tools | Templates
 * and open the template in the editor.
 */
package com.bettosimport.negocio;

import com.bettosimport.datos.TablasMaestrasDAO;
import com.bettosimport.entidades.Familia;
import com.bettosimport.entidades.Linea;
import com.bettosimport.entidades.Marca;
import com.bettosimport.entidades.Sucursal;
import java.util.ArrayList;

/**
 *
 * @author Neil
 */
public class TablasMaestrasNeg {

    private static TablasMaestrasNeg _Instancia;

    private TablasMaestrasNeg() {
    }

    public static TablasMaestrasNeg Instancia() {
        if (_Instancia == null) {
            _Instancia = new TablasMaestrasNeg();
        }
        return _Instancia;
    }

    public ArrayList<Linea> lineas() throws Exception {
        try {
            return TablasMaestrasDAO.Instancia().listarLineas();
        } catch (Exception e) {
            throw e;
        }
    }

    public Linea buscarLinea(int id) throws Exception {
        try {
            return TablasMaestrasDAO.Instancia().buscarLinea(id);
        } catch (Exception e) {
            throw e;
        }
    }

    public ArrayList<Familia> familias(int id) throws Exception {
        try {
            return TablasMaestrasDAO.Instancia().listarFamilias(id);
        } catch (Exception e) {
            throw e;
        }
    }

    public Familia buscarFamilia(int id) throws Exception {
        try {
            return TablasMaestrasDAO.Instancia().buscarFamilia(id);
        } catch (Exception e) {
            throw e;
        }
    }

    public ArrayList<Marca> marcas() throws Exception {
        try {
            return TablasMaestrasDAO.Instancia().listarMarcas();
        } catch (Exception e) {
            throw e;
        }
    }

    public Marca buscarMarca(int id) throws Exception {
        try {
            return TablasMaestrasDAO.Instancia().buscarMarca(id);
        } catch (Exception e) {
            throw e;
        }
    }

    public ArrayList<Sucursal> sucursales() throws Exception {
        try {
            return TablasMaestrasDAO.Instancia().listarSucursales();
        } catch (Exception e) {
            throw e;
        }
    }

    public Sucursal buscarSucursal(int id) throws Exception {
        try {
            return TablasMaestrasDAO.Instancia().buscarSucursal(id);
        } catch (Exception e) {
            throw e;
        }
    }

    public int guardarmodificarTM(Object[] o) throws Exception {
        try {
            return TablasMaestrasDAO.Instancia().guardarmodificarTM(o);
        } catch (Exception e) {
            throw e;
        }

    }

}
